'==================================================================================================
'	Author		David Segura
'	URL			http://winpeguy.com/
'	Source		http://winpe.codeplex.com/
'	Version		20130910
'==================================================================================================
'	Purpose:
'	Reads Registry Values to determine proper WinPE Menu Branding
'==================================================================================================
'	File Locations in Windows:
'	%DeployRoot%\Boot\+WinPE\Menu\Scripts\Branding.vbs
'==================================================================================================
'	File Location in WinPE:
'	X:\Menu\Scripts\Branding.vbs
'==================================================================================================
'	Configuration:
'	None.  Editing this file is not recommended
'	Modify the MyConfig\MyBranding.inf for customizations
'==================================================================================================
'	Change Log:
'	20130910	Codeplex Beta
'==================================================================================================
	If RegKeyExists("HKEY_LOCAL_MACHINE\SYSTEM\@WinPE\MyCompany") Then
		objRegistry.GetStringValue HKEY_LOCAL_MACHINE,"SYSTEM\@WinPE","MyCompany",strMyCompany
	Else
		strMyCompany = "WinPE Guy"								'Modify this to the Company if you are not using the Plugin WinPE Branding
	End If

	If RegKeyExists("HKEY_LOCAL_MACHINE\SYSTEM\@WinPE\MyDepartment") Then
		objRegistry.GetStringValue HKEY_LOCAL_MACHINE,"SYSTEM\@WinPE","MyDepartment",strMyDepartment
	Else
		strMyDepartment = "Global"								'Modify this to the Department if you are not using the Plugin WinPE Branding
	End If
	
	'Version is automatically calculated by the Last Modified attribute of X:\Windows\System32\Config\System
	Set objFSO	= CreateObject("Scripting.FileSystemObject")
	If objFSO.FileExists(envSystem32 & "\config\system") Then
		Set f		= objFSO.GetFile(envSystem32 & "\config\system")
		strYear		= DatePart("yyyy",f.DateLastModified)
		strMonth	= Right(String(2, "0") & Month(f.DateLastModified), 2)
		strDay		= Right(String(2, "0") & Day(f.DateLastModified), 2)
		strVersion	= strYear & strMonth & strDay
	End If
'==================================================================================================
'	The lines below do not need modifications
	strMenuName			=	"WinPE " & envBootArch & " Menu"											'Name of Menu with Version
	MsgBoxTitleShort	=	strMyCompany & " \\ " & strMenuName & " \\ "								'Short Message Box Title
	'MsgBoxTitle 		=	strMyCompany & " \\ " & strMenuName & " \\ Version " & ThisPageHTA.VERSION	'If you want to use the version in the HTA
	MsgBoxTitle 		=	strMyCompany & " \\ " & strMenuName & " " & strVersion
	document.Title		=	MsgBoxTitle

	'If the Boot Type and Boot Drive can be determined, this will be displayed as the Menu Title instead
	'Should display		............. \\ PXE Boot (Drive NONE)
	'Should display		............. \\ CD-ROM Boot (Drive D:\)
	'Should display		............. \\ Drive Boot (Drive E:\)
	If strPEBootType <> "" Then
		document.Title	=	MsgBoxTitle & " \\ " & strPEBootType & " Boot (Drive " & strPEBootDrive & ")"
	End If
'==================================================================================================
'	Help and Support Tile - Custom Message - Information Message icon displayed

	If RegKeyExists("HKEY_LOCAL_MACHINE\SYSTEM\@WinPE\TileHelpAndSupport_1") Then
		objRegistry.GetStringValue HKEY_LOCAL_MACHINE,"SYSTEM\@WinPE","TileHelpAndSupport_1",TileHelpAndSupport_1
	Else
		TileHelpAndSupport_1 = ""
	End If
	If RegKeyExists("HKEY_LOCAL_MACHINE\SYSTEM\@WinPE\TileHelpAndSupport_2") Then
		objRegistry.GetStringValue HKEY_LOCAL_MACHINE,"SYSTEM\@WinPE","TileHelpAndSupport_2",TileHelpAndSupport_2
	Else
		TileHelpAndSupport_2 = ""
	End If
	If RegKeyExists("HKEY_LOCAL_MACHINE\SYSTEM\@WinPE\TileHelpAndSupport_3") Then
		objRegistry.GetStringValue HKEY_LOCAL_MACHINE,"SYSTEM\@WinPE","TileHelpAndSupport_3",TileHelpAndSupport_3
	Else
		TileHelpAndSupport_3 = ""
	End If
	If RegKeyExists("HKEY_LOCAL_MACHINE\SYSTEM\@WinPE\TileHelpAndSupport_4") Then
		objRegistry.GetStringValue HKEY_LOCAL_MACHINE,"SYSTEM\@WinPE","TileHelpAndSupport_4",TileHelpAndSupport_4
	Else
		TileHelpAndSupport_4 = ""
	End If
	If RegKeyExists("HKEY_LOCAL_MACHINE\SYSTEM\@WinPE\TileHelpAndSupport_5") Then
		objRegistry.GetStringValue HKEY_LOCAL_MACHINE,"SYSTEM\@WinPE","TileHelpAndSupport_5",TileHelpAndSupport_5
	Else
		TileHelpAndSupport_5 = ""
	End If
	If RegKeyExists("HKEY_LOCAL_MACHINE\SYSTEM\@WinPE\TileHelpAndSupport_6") Then
		objRegistry.GetStringValue HKEY_LOCAL_MACHINE,"SYSTEM\@WinPE","TileHelpAndSupport_6",TileHelpAndSupport_6
	Else
		TileHelpAndSupport_6 = ""
	End If
	If RegKeyExists("HKEY_LOCAL_MACHINE\SYSTEM\@WinPE\TileHelpAndSupport_7") Then
		objRegistry.GetStringValue HKEY_LOCAL_MACHINE,"SYSTEM\@WinPE","TileHelpAndSupport_7",TileHelpAndSupport_7
	Else
		TileHelpAndSupport_7 = ""
	End If
	If RegKeyExists("HKEY_LOCAL_MACHINE\SYSTEM\@WinPE\TileHelpAndSupport_8") Then
		objRegistry.GetStringValue HKEY_LOCAL_MACHINE,"SYSTEM\@WinPE","TileHelpAndSupport_8",TileHelpAndSupport_8
	Else
		TileHelpAndSupport_8 = ""
	End If

	Sub subHelpandSupport
		MsgBox	TileHelpAndSupport_1 & vbCrLf & _
				TileHelpAndSupport_2 & vbCrLf & _
				TileHelpAndSupport_3 & vbCrLf & _
				TileHelpAndSupport_4 & vbCrLf & _
				TileHelpAndSupport_5 & vbCrLf & _
				TileHelpAndSupport_6 & vbCrLf & _
				TileHelpAndSupport_7 & vbCrLf & _
				TileHelpAndSupport_8,64,MsgBoxTitleShort & "Help and Support"
	End Sub
'==================================================================================================